pow.webserver
Class User

java.lang.Object
  extended by pow.webserver.User
All Implemented Interfaces:
java.io.Serializable

public class User
extends java.lang.Object
implements java.io.Serializable

represents a ivy or a web user account for the web user the account nest also the list of drones that the user can control the list contains the ivy name of the drone (MJ5, TJ1...). In Paparazzi a drone is not identified in a unique identifier, that means that if a user can pilot a drone MJ5, he can pilot all 'MJ5' drone

Author:
genin
See Also:
Serialized Form

Constructor Summary
User(java.lang.String log, java.lang.String pwd, Rights rght)
          create a user account
 
Method Summary
 void addDrone(java.lang.String d)
          add a drone name to the list of drones that the user can control
 boolean canControl(java.lang.String droneName)
          inform whether the user can pilot a drone or not
 void clearListDrone()
          reset the list of drone that the web user can control
 java.lang.String getListDrone()
          the list of drone that the web user can control
 java.lang.String getLogin()
           
 java.lang.String getPassword()
           
 Rights getRights()
           
 java.util.Iterator<java.lang.String> getSetItr()
           
 boolean IsPwdTrue(java.lang.String pwd)
          check if the password given in argument corresponds to the password user
 void setNom(java.lang.String log)
          specify the login of the user
 void setPwd(java.lang.String pwd)
          specify the user password, it's not stored in clear (md5 hash)
 void setRights(Rights r)
          specify the type of right granted to the user
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

User

public User(java.lang.String log,
            java.lang.String pwd,
            Rights rght)
create a user account

Parameters:
log - the login of the user
pwd - the password of the user
rght - the type of the user
Method Detail

getSetItr

public java.util.Iterator<java.lang.String> getSetItr()
Returns:
an iterator containing the list of all drone that the user can control

clearListDrone

public void clearListDrone()
reset the list of drone that the web user can control


getListDrone

public java.lang.String getListDrone()
the list of drone that the web user can control

Returns:
a formatted string containing all the drone that the user can control separated by commas

addDrone

public void addDrone(java.lang.String d)
add a drone name to the list of drones that the user can control

Parameters:
d -

canControl

public boolean canControl(java.lang.String droneName)
inform whether the user can pilot a drone or not

Parameters:
droneName - the name of the drone
Returns:
true if the user can pilot the drones with this name

getRights

public Rights getRights()
Returns:
the type of right granted to the user

setRights

public void setRights(Rights r)
specify the type of right granted to the user

Parameters:
r - the right granted to the user

getLogin

public java.lang.String getLogin()
Returns:
the login of the user

setNom

public void setNom(java.lang.String log)
specify the login of the user

Parameters:
log - the login of the user

getPassword

public java.lang.String getPassword()
Returns:
the password of the user encoded with md5 algorithm

setPwd

public void setPwd(java.lang.String pwd)
specify the user password, it's not stored in clear (md5 hash)

Parameters:
pwd - the user password in clear

IsPwdTrue

public boolean IsPwdTrue(java.lang.String pwd)
check if the password given in argument corresponds to the password user

Parameters:
pwd - the password to check
Returns:
true if the password is correct